//
// Created by hsj on 2022/1/18.
//

#ifndef CLION_CPP_T_CLASS_EXTEND_H
#define CLION_CPP_T_CLASS_EXTEND_H
#include <string>
namespace hsj_class_extend{
    using std::string;
    using std::cout;
    using std::endl;
    //测试类的继承
    void test_class_extend();

    //基类
    class TableTennisPlayer{
        private:
            string firstName;
            string lastName;
            bool hasTable;
        public:
            TableTennisPlayer(const string &fn = "none",const string &ln = "none",bool ht = false);
            void Name() const;
            bool HasTable(){return hasTable;};
            void ResetTable(bool v){
                hasTable = v;
            };
    };


    //继承
    class RatedPlayer: public TableTennisPlayer{
        private:
            unsigned int rating;
        public:
            RatedPlayer(unsigned int r,const string &fn = "none",const string &ln = "none",bool ht = false);
            RatedPlayer(unsigned int r,const TableTennisPlayer &ttp);
            unsigned int Rating(){return rating;}
            void ResetRating(unsigned int r){rating = r;};
    };
}
#endif //CLION_CPP_T_CLASS_EXTEND_H
